package HomeWork.Demo03;

import java.util.ArrayList;

public class test {
    public static void main(String[] args) {
        ArrayList<String> list1 = new ArrayList<>();
        ArrayList<Person> list2 = new ArrayList<>();
        ArrayList<Student> list3 = new ArrayList<>();
        ArrayList<JavaStudent> list4 = new ArrayList<>();
        ArrayList<UIStudent> list5 = new ArrayList<>();
        ArrayList<Teacher> list6 = new ArrayList<>();
        ArrayList<JavaTeacher> list7 = new ArrayList<>();
        ArrayList<UITeacher> list8 = new ArrayList<>();

//        //注意 : 泛型不支持多态 !!!
//        print1(list1);// 报错 , 泛型不支持多态
        accept(list1);
        accept(list2);
        accept(list3);
        accept(list4);
        accept(list5);
        accept(list6);
        accept(list7);
        accept(list8);

//      accept1(list1);
        accept(list2);
        accept(list3);
        accept(list4);
        accept(list5);
        accept(list6);
        accept(list7);
        accept(list8);

//        accept2(list1); String类
//        accept2(list2); Person类
        accept2(list3);//Student子类
        accept2(list4);//Student子类
        accept2(list5);//Student子类
//        accept2(list6); Teacher类
//        accept2(list7); Teacher子类
//        accept2(list8);Teacher子类


//        accept3(list1);
        accept3(list2); //Person类 javastudent的爷爷
        accept3(list3); //Student类 javastudent的爸爸
        accept3(list4); //javastudent类 本身
//        accept3(list5);
//        accept3(list6);
//        accept3(list7);
//        accept3(list8);




    }
    public static <E> void accept(ArrayList<E> list){

    }
    public static <E extends Person> void accept1(ArrayList<E> list){
        //public static void accept1(ArrayList<? extends Person> list)
    }

    public static void accept2(ArrayList<? extends Student> list){

    }
    public static void accept3(ArrayList<? super JavaStudent> list){

    }
}
